package com.example.learn_android;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class ClickLongListener extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_click_long_listener);
        TextView text=findViewById(R.id.clickLongResult);
        Button btn=findViewById(R.id.clickLongListener);
        btn.setOnLongClickListener(v -> {
            text.setText("点击后内容");
            return true;
        });
    }
}